{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas\n",
    "\n",
    "df_ad = pandas.read_csv('2020ad.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_list = df_ad['姓名'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "学号      1\n",
       "姓名      1\n",
       "仓库地址    1\n",
       "dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "df_ad[df_ad['姓名'] == '马玉兰'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df_ad['姓名'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = {'姓名':stu_list,'次数':[],'仓库地址':[]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "马玉兰 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "余娇 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "江中诚 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "冉小军 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "夏平琴 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "杨凯岑 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "崔山林 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "冉西谊 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王霞 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "肖玲玲 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "马有花 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "沙珂鑫 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "文怡心 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王佳宁 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王海燕 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王文阳 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "胡文静 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "杨芸 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "曾霈婷 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "李建晴 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "沙容容 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "陆覃慧 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "刘雨欣 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "梁爽 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "吴倩 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "杨佳骏 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "郭璇 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "韦丹丹 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王隆琴 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "李爱翠 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "盖馨月 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "崔维 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "冯静仪 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "马晓炜 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "韦燕芬 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "张思凡 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "仲格尔吉 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "潘小燕 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "傅加雨 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "马小春 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "李同 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "和鎏 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "郭善鑫 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "马芳甜 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "马扬 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "朱襄竹 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "邓林云 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "马梦飞 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "刘睿奕 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "董丽缘 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王艺豪 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "周銮 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "西仁娜依·阿布来克 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "李晓燕 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "李睿麒 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "宋昕忆 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "苏丽华 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "刘星宇 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "张兴乐 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "邹雅婷 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "隆文航 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "乔轩 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "张湘粤 学号      2\n",
      "姓名      2\n",
      "仓库地址    2\n",
      "dtype: int64\n",
      "马玉红 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "闭明阳 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "司雨航 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "张双 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "龙云荟 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "郭嘉宇 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "韦大明 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "拥倩卓玛 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "艾力飞热·艾尼玩 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "陆胜减 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "郭育汝 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "禹小双 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "刘素玲 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "吕小艳 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "吴亦杰 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "王一凡 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "李苑萌 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n",
      "曹凡 学号      1\n",
      "姓名      1\n",
      "仓库地址    1\n",
      "dtype: int64\n"
     ]
    }
   ],
   "source": [
    "for stu_name in stu_list:\n",
    "  count = df_ad[df_ad['姓名'] == stu_name].count()\n",
    "  print(stu_name,count)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "马玉兰 1\n",
      "余娇 2\n",
      "江中诚 1\n",
      "冉小军 1\n",
      "夏平琴 1\n",
      "杨凯岑 1\n",
      "崔山林 1\n",
      "冉西谊 1\n",
      "王霞 1\n",
      "肖玲玲 1\n",
      "马有花 1\n",
      "沙珂鑫 2\n",
      "文怡心 1\n",
      "王佳宁 1\n",
      "王海燕 1\n",
      "王文阳 1\n",
      "胡文静 1\n",
      "杨芸 1\n",
      "曾霈婷 1\n",
      "李建晴 1\n",
      "沙容容 1\n",
      "陆覃慧 1\n",
      "刘雨欣 1\n",
      "梁爽 2\n",
      "吴倩 1\n",
      "杨佳骏 1\n",
      "郭璇 2\n",
      "韦丹丹 1\n",
      "王隆琴 1\n",
      "李爱翠 1\n",
      "盖馨月 1\n",
      "崔维 1\n",
      "冯静仪 1\n",
      "马晓炜 1\n",
      "韦燕芬 1\n",
      "张思凡 2\n",
      "仲格尔吉 1\n",
      "潘小燕 2\n",
      "傅加雨 1\n",
      "马小春 1\n",
      "李同 1\n",
      "和鎏 1\n",
      "郭善鑫 1\n",
      "马芳甜 1\n",
      "马扬 1\n",
      "朱襄竹 1\n",
      "邓林云 1\n",
      "马梦飞 1\n",
      "刘睿奕 1\n",
      "董丽缘 1\n",
      "王艺豪 1\n",
      "周銮 1\n",
      "西仁娜依·阿布来克 1\n",
      "李晓燕 1\n",
      "李睿麒 1\n",
      "宋昕忆 1\n",
      "苏丽华 1\n",
      "刘星宇 1\n",
      "张兴乐 1\n",
      "邹雅婷 1\n",
      "隆文航 1\n",
      "乔轩 1\n",
      "张湘粤 2\n",
      "马玉红 1\n",
      "闭明阳 1\n",
      "司雨航 1\n",
      "张双 1\n",
      "龙云荟 1\n",
      "郭嘉宇 1\n",
      "韦大明 1\n",
      "拥倩卓玛 1\n",
      "艾力飞热·艾尼玩 1\n",
      "陆胜减 1\n",
      "郭育汝 1\n",
      "禹小双 1\n",
      "刘素玲 1\n",
      "吕小艳 1\n",
      "吴亦杰 1\n",
      "王一凡 1\n",
      "李苑萌 1\n",
      "曹凡 1\n"
     ]
    }
   ],
   "source": [
    "for name in stu_list:\n",
    "  count = df_ad[df_ad['姓名'] == name]['姓名'].count()\n",
    "  print(name,count)\n",
    "  result['次数'].append(count)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'姓名': array(['马玉兰', '余娇', '江中诚', '冉小军', '夏平琴', '杨凯岑', '崔山林', '冉西谊', '王霞', '肖玲玲',\n",
      "       '马有花', '沙珂鑫', '文怡心', '王佳宁', '王海燕', '王文阳', '胡文静', '杨芸', '曾霈婷',\n",
      "       '李建晴', '沙容容', '陆覃慧', '刘雨欣', '梁爽', '吴倩', '杨佳骏', '郭璇', '韦丹丹', '王隆琴',\n",
      "       '李爱翠', '盖馨月', '崔维', '冯静仪', '马晓炜', '韦燕芬', '张思凡', '仲格尔吉', '潘小燕',\n",
      "       '傅加雨', '马小春', '李同', '和鎏', '郭善鑫', '马芳甜', '马扬', '朱襄竹', '邓林云', '马梦飞',\n",
      "       '刘睿奕', '董丽缘', '王艺豪', '周銮', '西仁娜依·阿布来克', '李晓燕', '李睿麒', '宋昕忆', '苏丽华',\n",
      "       '刘星宇', '张兴乐', '邹雅婷', '隆文航', '乔轩', '张湘粤', '马玉红', '闭明阳', '司雨航', '张双',\n",
      "       '龙云荟', '郭嘉宇', '韦大明', '拥倩卓玛', '艾力飞热·艾尼玩', '陆胜减', '郭育汝', '禹小双',\n",
      "       '刘素玲', '吕小艳', '吴亦杰', '王一凡', '李苑萌', '曹凡'], dtype=object), '次数': [1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], '仓库地址': []}\n"
     ]
    }
   ],
   "source": [
    "print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学号</th>\n",
       "      <th>姓名</th>\n",
       "      <th>仓库地址</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>P201212156</td>\n",
       "      <td>余娇</td>\n",
       "      <td>https:// gitte.com/yujiao2001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>P201212156</td>\n",
       "      <td>余娇</td>\n",
       "      <td>https://gitee.com/yujiao2001/projects</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            学号  姓名                                   仓库地址\n",
       "1   P201212156  余娇          https:// gitte.com/yujiao2001\n",
       "67  P201212156  余娇  https://gitee.com/yujiao2001/projects"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_ad[df_ad['姓名'] == '余娇']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "pandas.DataFrame(result,columns=['姓名','次数']).to_csv('stu-count.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>姓名</th>\n",
       "      <th>次数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>马玉兰</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>余娇</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>江中诚</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>冉小军</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>夏平琴</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>76</td>\n",
       "      <td>吕小艳</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>77</td>\n",
       "      <td>吴亦杰</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>78</td>\n",
       "      <td>王一凡</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>79</td>\n",
       "      <td>李苑萌</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>80</td>\n",
       "      <td>曹凡</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>81 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Unnamed: 0   姓名  次数\n",
       "0            0  马玉兰   1\n",
       "1            1   余娇   2\n",
       "2            2  江中诚   1\n",
       "3            3  冉小军   1\n",
       "4            4  夏平琴   1\n",
       "..         ...  ...  ..\n",
       "76          76  吕小艳   1\n",
       "77          77  吴亦杰   1\n",
       "78          78  王一凡   1\n",
       "79          79  李苑萌   1\n",
       "80          80   曹凡   1\n",
       "\n",
       "[81 rows x 3 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pandas.read_csv('stu-count.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "学号           姓名         仓库地址                                             \n",
       "P201212093   沙珂鑫        https://gitee.com/gojosatoru/xiawu.git               2\n",
       "P201212139   张湘粤        https://gitee.com/zhangxiangyue123/diyicizuye.git    2\n",
       "P200410463   朱襄竹        https://gitee.com/yangjh/web-dev-18ad2.git           1\n",
       "P201212156   余娇         https:// gitte.com/yujiao2001                        1\n",
       "P201212154   肖玲玲        https://gitee.com/xiaoll68/class-ad2.git             1\n",
       "                                                                            ..\n",
       "P201212114   王海燕        wanghaiyan644534                                     1\n",
       "P201212112   西仁娜依·阿布来克  https://gitee.com/xirennayi/wangjiaer.git            1\n",
       "P201212111   张兴乐        https://gitee.com/zhangxingle/zxl.git                1\n",
       "P201212109   吴倩         https://gitee.com/wuzting/dashboard/projects         1\n",
       "p 201212092  周銮         https://gitee.com/zhouluan/kry                       1\n",
       "Length: 86, dtype: int64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_ad.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "result2 = df_ad['姓名'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'userName': 'ze-yan-0416', 'repoName': 'zeyankaixin'}\n",
      "{'userName': 'ze-yan-0416', 'repoName': 'zeyankaixin.git2'}\n",
      "None\n",
      "{'userName': 'ze-yan-0416', 'repoName': 'zeyankaixin'}\n",
      "None\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "import re\n",
    "\n",
    "def getRepoInfo(repoUrl):\n",
    "  result = {}\n",
    "  pattern = r'^https://gitee\\.com/(?P<userName>[^/]*?)/(?P<repoName>[\\w\\-\\.+]+?)(\\.git)?$'\n",
    "  m = re.match(pattern, repoUrl,re.M)\n",
    "  if m:\n",
    "    # return m\n",
    "    result['userName'] = m.group('userName')\n",
    "    result['repoName'] = m.group('repoName')\n",
    "    return result\n",
    "  else:\n",
    "    return None\n",
    "    \n",
    "    \n",
    "print(getRepoInfo('https://gitee.com/ze-yan-0416/zeyankaixin.git'))\n",
    "print(getRepoInfo('https://gitee.com/ze-yan-0416/zeyankaixin.git2'))\n",
    "print(getRepoInfo('https://gitee.com/ze-yan-0416/zeyankaixin.git)'))\n",
    "print(getRepoInfo('https://gitee.com/ze-yan-0416/zeyankaixin'))\n",
    "print(getRepoInfo('http://gitee.com/ze-yan-0416/'))\n",
    "print(getRepoInfo('https://gitee.com/wuzting/dashboard/projects'))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_ad['地址检测结果'] = df_ad['仓库地址'].apply(getRepoInfo)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import re\n",
    "\n",
    "p = r'python'\n",
    "\n",
    "m = re.match(p,'python Life is short, I use Python!,python',re.I)\n",
    "\n",
    "print(m)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_ad['地址检测结果'] = df_ad['仓库地址'].apply(getRepoInfo)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import math\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "x = np.arange(0, math.pi*2, 0.05)\n",
    "y = np.sin(x)\n",
    "\n",
    "plt.plot(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = np.arange(3,19)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "y =[1,2,3,4,5,6,7,7,8,8,0,1,1,1,5,6]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.bar(x,y)"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
  },
  "kernelspec": {
   "display_name": "Python 3.9.1 64-bit",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.1"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
